package com.ys.enume;

public enum MarketPlaceEnum {

	US("ATVPDKIKX0DER", "美国", "US", "Amazon.com", "NORTH"),
	BR("A2Q3Y263D00KWC", "巴西", "BR", "", "NORTH"),
	MX("A1AM78C64UM0Y8", "墨西哥", "MX", "Amazon.com.mx", "NORTH"),
	CA("A2EUQ1WTGCTBG2", "加拿大", "CA", "Amazon.ca", "NORTH"),
	
	SG("A19VAU5U5O7RUS", "新加坡", "SG", "", "ASIA"),
	JP("A1VC38T7YXB528", "日本", "JP", "", "ASIA"),
	AU("A39IBJ37TRP1C6", "澳大利亚", "AU", "", "ASIA"),
	
	PL("A1C3SOZRARQ6R3", "波兰", "PL", "Amazon.pl", "EUROPE"),
	NL("A1805IZSGTT6HS", "荷兰", "NL", "Amazon.nl", "EUROPE"),
	IT("APJ6JRA9NG5V4", "意大利", "IT", "Amazon.it", "EUROPE"),
	IN("A21TJRUUN4KGV", "印度", "IN", "", "EUROPE"),
	AE("A2VIGQ35RCS4UG", "阿拉伯联合酋长国", "AE", "", "EUROPE"),
	SA("A17E79C6D8DWNP", "沙特阿拉伯", "SA", "", "EUROPE"),
	TR("A33AVAJ2PDY3EV", "土尔其", "TR", "Amazon.com.tr", "EUROPE"),
	FR("A13V1IB3VIYZZH", "法国", "FR", "Amazon.fr", "EUROPE"),
	GB("A1F83G8C2ARO7P", "英国", "GB", "Amazon.co.uk", "EUROPE"),
	GB2("A1F83G8C2ARO7P", "英国", "GB", "SI UK Prod Marketplace", "EUROPE"),
	GB3("A1F83G8C2ARO7P", "英国", "UK", "SI UK Prod Marketplace", "EUROPE"),
	BE("AMEN7PMS3EDWL", "比利时", "BE", "Amazon.com.be", "EUROPE"),
	EG("ARBP9OOSHTCHU", "埃及", "EG", "", "EUROPE"),
	ES("A1RKKUPIHCS9HS", "西班牙", "ES", "Amazon.es", "EUROPE"),
	DE("A1PA6795UKMFR9", "德国", "DE", "Amazon.de", "EUROPE"),
	SE("A2NODRKZP88ZB9", "瑞典", "SE", "Amazon.se", "EUROPE");
	public String id;
	public String name;
	public String code;
	public String channel;
	public String region;

	private MarketPlaceEnum(String id, String name, String code, String channel, String region) {
		this.id = id;
		this.name = name;
		this.code = code;
		this.channel = channel;
		this.region = region;
	}
	
	public static boolean checkInId(String id) {
		if (id == null || id.length() == 0) {
			return false;
		}
		for (MarketPlaceEnum e : MarketPlaceEnum.values()) {
			if (e.id.equals(id)) {
				return true;
			}
		}
		return false;
	}
	
	public static boolean checkInChannel(String channel) {
		if (channel == null || channel.length() == 0) {
			return false;
		}
		for (MarketPlaceEnum e : MarketPlaceEnum.values()) {
			if (e.channel.equals(channel)) {
				return true;
			}
		}
		return false;
	}
	
	/*
	 * 通过渠道获取ID
	 */
	public static String getIdByChannel(String channel) {
		if (channel == null || channel.length() == 0) {
			return null;
		}
		for (MarketPlaceEnum e : MarketPlaceEnum.values()) {
			if (e.channel.equals(channel)) {
				return e.id;
			}
		}
		return null;
	}
}
